using SaleManagement.Controllers;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SaleManagement.modules
{
    public partial class frmAdd_Edit_KhoHang : Form
    {
        public WarehouseController whc;
        public frmAdd_Edit_KhoHang()
        {
            InitializeComponent();
            whc = new WarehouseController();
        }
        public void getdata()
        {

        }
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (ValidateInput() == false)
            {
                this.DialogResult = DialogResult.OK;
                whc.setdata(txtName.Text, rtbAddress.Text, rtbComment.Text);
            }
            else
            {
                this.DialogResult = DialogResult.None;
            }
        }
        public bool ValidateInput()
        {
            bool treck = false;
            if (txtName.Text == "")
            {
                MessageBox.Show("ban phai nhap name");
                return treck = true;
            }
            if (rtbAddress.Text == "")
            {
                MessageBox.Show("ban phai nhap diachi");
                return treck = true;
            }
            if (rtbComment.Text == "")
            {
                MessageBox.Show("ban phai nhap comment");
                return treck = true;
            }
            return treck;
            
        }

        private void frmAdd_Edit_KhoHang_Load(object sender, EventArgs e)
        {

        }
      
       
    }
}
